﻿@{
    ViewBag.Title = "下架指令管理";
    Layout = "~/Views/Shared/_JQBaseLayOut.cshtml";
}

@section JQscriptSection{
    <script src="../../Scripts/viewsScript/Shelves/OffShelvesC.js" type="text/javascript"></script>
    <script src="../../Scripts/viewsScript/Common/MyDialog.js" type="text/javascript"></script>
    <script src="../../Scripts/jqueryeasyui/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
    <script src="../../Scripts/Jquery.easy.ui.extend.js" type="text/javascript"></script>
    <script src="../../Scripts/Common.js" type="text/javascript"></script>
    <script type="text/javascript">

            function checkgoodscode() {
                var code = $.trim($("#txtGoodsCode").attr("value"));
                if (code != "") {
                    $('#location').form('submit', {
                        url: '@Url.Content("~/Location/checkGoodsExist")',
                        success: function (data) {
                            eval('data=' + data);
                            if (data.success) {

                            } else {
                                $.messager.alert('错误', data.msg, 'error');
                                $("#txtGoodsCode").val("").focus();
                            }
                        }
                    });
                }
            }
            function ExporterExcel() {
                var form = $('#query');
                var rows = $(".pagination-page-list option:selected").text();
                var page = $("input[size='2']").val();
                form.form('submit', {
                    url: '@Url.Content("~/Shelves/ExportExcel")' + '?page=' + page + '&rows=' + rows,
                    success: function (data) {
                        eval('data=' + data);
                        if (data.success) {
                            InitGrid();
                        } else {
                            $.messager.alert('错误', data.msg, 'error');
                        }
                    }
                });
            }
            function Import() {
                var form = $('#import');
                form.form('submit', {
                    url: '/Shelves/ImportOffShelves',
                    success: function (data) {
                        eval('data=' + data);
                        if (data.success) {
                            InitGrid();
                        } else {
                            $.messager.alert('错误', data.msg, 'error');
                        }
                    }
                });
            };
    </script>
}
<body style="background-color: ButtonFace; font-size: 17px" @*onload="InitGrid();"*@>

    <div id="p2" class="easyui-panel" title="查询条件" style="height: 130px; padding: 5px; background: #fafafa;">
        <form id="query" method="post">
            <table>
                <tr>
                    <td>作业批次号:
                    </td>
                    <td>
                        <input id="txtSBatchNO" name="txtSBatchNO" style="width: 154px" />
                    </td>
                    <td>商品编码:
                    </td>
                    <td>
                        <input id="txtSGOODSCODE" name="txtSGOODSCODE" style="width: 154px" />
                    </td>
                    <td>商品名称:
                    </td>
                    <td>
                        <input id="txtSGOODSNAME" name="txtSGOODSNAME" style="width: 154px" />
                    </td>
                </tr>
            </table>
            <table>
                <tr>
                    <td>状态:
                    </td>
                    <td>
                        <select id="SFlag" class="easyui-combobox" name="SFlag" style="width: 154px;">
                            <option value="">全部</option>
                            <option value="0">未处理</option>
                            <option value="40">在执行</option>
                            <option value="100">已完结</option>
                        </select>
                    </td>
                    <td>库位:
                    </td>
                    <td>
                        <select id="CellNo" class="easyui-combogrid" name="CellNo" style="width: 154px;"
                            data-options="
                        idField:'CELLNO',
                        textField:'CELLNO',
                        url:'@Url.Content("/BaseData/CellNoList?IsSetAll=0")',
                        columns:[[
                            {field:'CELLNO',title:'库位',width:120}
                        ]]
                    ">
                        </select>
                    </td>
                    <td>指定配送日期：
                    </td>
                    <td>
                        <input class="easyui-datebox" id="CheckTimeS" name="CheckTimeS" style="width: 140px;" />
                    </td>
                    <td>~：
                    </td>
                    <td>
                        <input class="easyui-datebox" id="CheckTimeE" name="CheckTimeE" style="width: 140px;" validtype="compareDate['#CheckTimeS']" />
                    </td>
                    <td>
                        <a id="btnSerach" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-search'" onclick="InitGrid()">查询</a>
                    </td>
                </tr>
            </table>
        </form>
        <form id="import" method="post" enctype="multipart/form-data">
            <table>
                <tr>
                    <td>
                        <input id="FileUpload" type="file" name="files" style="width: 250px; height: 24px; background: White"
                            class="easyui-validatebox" />
                        <a id="btnImport" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-upload'" onclick="Import()">导入</a>
                    </td>
                    <td>
                        <a id="btnExecl" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-excel'" onclick="ExporterExcel()">导出</a>
                    </td>
                </tr>
            </table>
        </form>
    </div>

    <div>
        <table id="tab_list">
        </table>
    </div>
    <div id="p1" class="easyui-dialog" style="width: 650px; height: 240px; padding: 10px 20px" closed="true" buttons="#dlg-buttons">
        <form id="location" method="post">
            <table>
                <tr>
                    <td>批次号:
                    </td>
                    <td>
                        <input id="hiddenOFFSHELVESID" name="hiddenOFFSHELVESID" type="hidden" />
                        <input id="BatchNo" name="BatchNo" maxlength="32" style="width: 154px" />
                    </td>
                    <td>商品编码:
                    </td>
                    <td colspan="2">
                        <input id="txtGoodsCode" name="txtGoodsCode" maxlength="10" style="width: 154px" onblur="checkgoodscode()" />
                    </td>
                </tr>
                <tr>
                    <td>数量:
                    </td>
                    <td>
                        <input id="txtQTY" name="txtQTY" maxlength="10" style="width: 154px" />
                    </td>
                    <td>指定配送日期:
                    </td>
                    <td colspan="2">
                        <input class="easyui-datebox" id="OffShelvesDate" name="OffShelvesDate" style="width: 154px;" />
                    </td>
                </tr>
                @*<tr>
                    <td>实际执行数量:
                    </td>
                    <td>
                        <input id="txtQTYEXCE" name="txtQTYEXCE" maxlength="10" style="width: 154px" />
                    </td>
                    <td>状态:
                    </td>
                    <td colspan="2">
                        <select id="Flag" class="easyui-combobox" name="Flag" style="width: 154px;">
                            <option value="0">未处理</option>
                            <option value="40">在执行</option>
                            <option value="100">已完结</option>
                        </select>
                    </td>
                </tr>*@
                <tr>
                    <td>备注:
                    </td>
                    <td colspan="4">
                        <input id="txtRemark" name="txtRemark" maxlength="255" style="width: 520px" />
                    </td>
                </tr>

                <tr>
                    <td colspan="5">
                        <a id="btnSave" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-save'" onclick="save()">保存</a>
                    </td>
                </tr>
            </table>
        </form>
    </div>

</body>
